import request, { Method } from '@/plugins/request.js'

// 保存修改订单
export function saveDesired(params) {
  return request({
    url: '/app/desired/saveDesired',
    method: Method.POST,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    data: params
  })
}

// 获取需求列表
export function getDesiredList(params) {
  return request({
    url: '/app/index/getDesiredList',
    method: Method.GET,
    needToken: true,
    params
  })
}
// 获取需求详情(用户)
export function getDesiredById(params) {
  return request({
    url: '/app/desired/getDesiredById',
    method: Method.GET,
    needToken: true,
    params
  })
}
// 获取需求详情(写手)
export function getDesiredInfo(params) {
  return request({
    url: '/app/desired/getDesiredInfo',
    method: Method.GET,
    needToken: true,
    params
  })
}
// 获取订单类型
export function getOrderTypeList(params) {
  return request({
    url: '/app/index/getOrderTypeList',
    method: Method.GET,
    needToken: true,
    params
  })
}
// 获取轮播图列表
export function getBannerList(params) {
  return request({
    url: '/app/index/getBannerList',
    method: Method.GET,
    needToken: true,
    params
  })
}
// 获取我参与的订单
export function getOrderListByUserId(params) {
  return request({
    url: '/app/user/getOrderListByUserId',
    method: Method.GET,
    needToken: true,
    params
  })
}
// 获取我参与的订单反馈信息
export function getOrderApportionByUserId(params) {
  return request({
    url: '/app/user/getOrderApportionByUserId',
    method: Method.GET,
    needToken: true,
    params
  })
}
// 提交我参与的订单反馈信息
// export function saveOrderApportion (params) {
//   return request({
//     url: '/app/user/saveOrderApportion',
//     method: Method.POST,
//     needToken: true,
//     headers: {'Content-Type': 'application/json'},
//     data: params
//   })
// }
export function saveOrderApportion(params) {
  return request({
    url: '/app/desired/submitOrderFeedback',
    method: Method.POST,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    data: params
  })
}
// 需求支付成功  （测试用）
export function updateDesired(params) {
  return request({
    url: '/app/index/updateDesired',
    method: Method.POST,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    data: params
  })
}
// 审核提交的需求完成信息
export function auditOrderFeedback(params) {
  return request({
    url: '/app/desired/auditOrderFeedback',
    method: Method.POST,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    data: params
  })
}
// 保存订单评价
export function saveEvaluate(params) {
  return request({
    url: '/app/user/saveEvaluate',
    method: Method.POST,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    data: params
  })
}
// 保存意见反馈内容
export function saveFeedback(params) {
  return request({
    url: '/app/user/saveFeedback',
    method: Method.POST,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    data: params
  })
}
// 申请订单售后
export function orderAfterSale(params) {
  return request({
    url: '/app/desired/orderAfterSale',
    method: Method.GET,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 获取订单记录信息
export function getOrderRecords(params) {
  return request({
    url: '/app/desired/getOrderRecords',
    method: Method.GET,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 获取需求订单记录信息
export function writerDesiredList(params) {
  return request({
    url: '/writer/desired/list',
    method: Method.GET,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 用户搜索记录
export function getSearchList(params) {
  return request({
    url: '/app/user/getSearchList',
    method: Method.GET,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 获取我的订单 需求信息
export function getOrderList(params) {
  return request({
    url: '/app/index/getOrderList',
    method: Method.GET,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 获取我发布的需求
export function getMyDesiredList(params) {
  return request({
    url: '/app/desired/getMyDesiredList',
    method: Method.GET,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 订单尾款支付
export function payOrder(params) {
  return request({
    url: '/app/index/payOrder',
    method: Method.POST,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    data: params
  })
}
// sendSMS
export function sendSMS(params) {
  return request({
    url: '/app/sendSMS',
    method: Method.GET,
    needToken: false,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 获取我的订单支付记录
export function getOrderPayList(params) {
  return request({
    url: '/app/user/getOrderPayList',
    method: Method.GET,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 收益记录
export function getOrderApportion(params) {
  return request({
    url: '/app/user/getOrderApportion',
    method: Method.GET,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 提现记录
export function getTixianList(params) {
  return request({
    url: '/app/user/getTixianList',
    method: Method.GET,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 提现申请
export function applyTixian(params) {
  return request({
    url: '/app/user/applyTixian',
    method: Method.POST,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    data: params
  })
}
// 完成订单
export function completeOrder(params) {
  return request({
    url: '/app/desired/completeOrder',
    method: Method.GET,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 获取用户余额信息
export function getUserMoney(params) {
  return request({
    url: '/app/user/getUserMoney',
    method: Method.GET,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 提现验证码
export function sendSMSTixian(params) {
  return request({
    url: '/app/sendSMSTixian',
    method: Method.GET,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 修改手机号用验证码
export function sendSMSPhone(params) {
  return request({
    url: '/app/sendSMSPhone',
    method: Method.GET,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 验证码修改用户手机号
export function updatePhone(params) {
  return request({
    url: '/app/user/updatePhone',
    method: Method.POST,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    data: params
  })
}
// 保存补充需求信息
export function supplementDesired(params) {
  return request({
    url: '/app/desired/supplementDesired',
    method: Method.POST,
    needToken: true,
    headers: { 'Content-Type': 'application/json' },
    data: params
  })
}
// 修改密码用验证码
export function sendSMSPassword(params) {
  return request({
    url: '/app/sendSMSPassword',
    method: Method.GET,
    needToken: false,
    headers: { 'Content-Type': 'application/json' },
    params
  })
}
// 验证码修改用户密码
export function updatePassword(params) {
  return request({
    url: '/app/user/updatePassword',
    method: Method.POST,
    needToken: false,
    headers: { 'Content-Type': 'application/json' },
     data:params
  })
}